<%@ page import="com.psl.model.product" %>
<%@ page import="com.psl.model.userlogin" %>
<%@ page import="com.psl.services.search" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="java.util.List" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String p_name = request.getParameter("p_name");
    userlogin userinfo = (userlogin) session.getAttribute("user");
    if (userinfo == null) {
        response.sendRedirect("/login.do");
    }
%>
<!DOCTYPE html >
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <title>产品资料</title>
    <link href="../../assets/css/layout.css" rel="stylesheet" type="text/css">
    <script type="text/javascript">
        function add() {
            window.location.href = "/infoDetail/ProductDetail.jsp"
        }
    </script>
    <style>
        body{
            font-size: 15px;
        }
    </style>
</head>

<body>
<form id="form1" name="form1" method="post" action="../../Invoice/CommericalInvoice.html">
    <table width="99%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#AEDEF4">
        <tbody>
        <tr>
            <td height="25" colspan="5" align="center" bgcolor="#D6F2FD">
                产品清单
            </td>
            <td colspan="4" bgcolor="#D6F2FD" align="center"><input type="button" value="添加" onclick="add()"/></td>
            <td colspan="4" bgcolor="#D6F2FD" align="center">
                <form action="/search.do" method="post">
                    <input type="text" name="p_name" value=""/><input type="submit" value="search"/>
                </form>
            </td>
        </tr>
        <tr>
            <td align="center" bgcolor="#FFF9DF">SELECT</td>
            <td height="25" align="center" bgcolor="#FFF9DF">PRODUCT NO.</td>
            <td height="25" align="center" bgcolor="#FFF9DF">PRODUCT NAME</td>
            <td align="center" bgcolor="#FFF9DF">商标</td>
            <td align="center" bgcolor="#FFF9DF">PN</td>
            <td align="center" bgcolor="#FFF9DF">UNIT WEIGHT</td>
            <td align="center" bgcolor="#FFF9DF">UNIT PRICE</td>
            <td align="center" bgcolor="#FFF9DF">库存数</td>
            <td align="center" bgcolor="#FFF9DF">包装箱内尺寸</td>
            <td align="center" bgcolor="#FFF9DF" colspan="2">ORDER Q.TY</td>
        </tr>
        <jsp:useBean id="product" class="com.psl.model.product"/>
        <% search ar = new search();
            List mo = ar.searchlist(p_name);
            Iterator iter = mo.iterator();
            product aRe = null;
            while (iter.hasNext()) {
                aRe = (product) iter.next();
        %>
        <tr>
            <td align="center" bgcolor="#FFF9DF"><input type="checkbox" name="choose" value="mutichoose"/></td>
            <td height="25" align="center" bgcolor="#FFF9DF"><a
                    href="/infoDetail/ProductDetail.jsp?p_id=<%=aRe.getP_no()%>"><%=aRe.getP_no()%>
            </a></td>
            <td height="25" align="center" bgcolor="#FFF9DF"><%=aRe.getP_name()%>
            </td>
            <td height="25" align="center" bgcolor="#FFF9DF"><%=aRe.getP_r()%>
            </td>
            <td align="center" bgcolor="#FFF9DF"><%=aRe.getP_n()%>
            </td>
            <td align="center" bgcolor="#FFF9DF"><%=aRe.getP_uw()%>
            </td>
            <td align="center" bgcolor="#FFF9DF"><%=aRe.getP_up()%>
            </td>
            <td align="center" bgcolor="#FFF9DF"><%=aRe.getP_kc()%>
            </td>
            <td align="center" bgcolor="#FFF9DF"><%=aRe.getP_size()%>
            </td>
            <td align="center" bgcolor="#FFF9DF" colspan="2">
                <input name="number" type="number" id="number" value="1" size="4" min="1" max="15000"
                       onblur="changePrice()"/>
            </td>
        </tr>
        <%}%>
        <tr align="center">
            <td bgcolor="#D6F2FD" colspan="3">
                总计：设备数<span class="STYLE1"></span>台 计划经费：<span class="STYLE1"></span>元 支付总额:<span class="STYLE1"></span>元
            </td>
            <td colspan="1" bgcolor="#D6F2FD"><input type="submit" name="button" value="制作形式发票"></td>
            <td colspan="1" bgcolor="#D6F2FD"><input type="submit" name="button" value="制作商业发票"></td>
            <td colspan="1" bgcolor="#D6F2FD"><input type="submit" name="button" value="制作装箱单"></td>
            <td colspan="1" bgcolor="#D6F2FD" align="center"><input type="button" value="导出XLS"/></td>
            <td colspan="4" bgcolor="#D6F2FD" align="center"><a href="">导入模板下载</a>批量导入：<input type="file"
                                                                                              value=""/><input
                    type="submit" value="导入"/></td>
        </tr>
        </tbody>
    </table>
</form>
</body>
</html>